<?php
    
    $options = array(
        'encoding'           => 'UTF-8',
        'connection_timeout' => 5,
        'exceptions'         => 1,
    );
    
    $location = 'http://www.OpenLigaDB.de/Webservices/Sportsdata.asmx?WSDL';
    $soapClient = new SoapClient($location, $options);
    $params = new stdClass;
    $params->leagueShortcut = "wm_brasilien";
    $params->leagueSaison = "2014";
    
    if($_POST['message'] == 'GetMatchdataByGroupLeagueSaison'){
        $params->groupOrderID = $_POST['groupOrderID'];
        $response = $soapClient->GetMatchdataByGroupLeagueSaison($params);    
    }else if($_POST['message'] == 'GetMatchdataByLeagueDateTime'){
        $params->fromDateTime = $_POST['fromDateTime'];
        $params->toDateTime = $_POST['toDateTime'];
        $response = $soapClient->GetMatchdataByLeagueDateTime($params);   
    }else if($_POST['message'] == 'GetMatchByMatchID'){
        $params->MatchID = $_POST['matchID'];
        $response = $soapClient->GetMatchByMatchID($params);   
    }else if($_POST['message'] == 'GetAvailGroups'){
        $response = $soapClient->GetAvailGroups($params);
    }

    echo json_encode($response);
    die();
    
?>